<!-- 通用CSS -->
<head th:fragment=header(title)>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="renderer" content="webkit">
	<title th:text="${title}"></title>
	<link rel="shortcut icon" href="favicon.ico">
	<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
	<link th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
	<!--bootstrap-select 下拉框插件-->
	<link th:href="@{/css/bootstrap-select.min.css}" rel="stylesheet"/>
	<!-- bootstrap-table 表格插件样式 -->
	<link th:href="@{/ajax/libs/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
	<link th:href="@{/css/animate.css}" rel="stylesheet"/>
	<link th:href="@{/css/style.css}" rel="stylesheet"/>
	<link th:href="@{/ruoyi/css/ry-ui.css}" rel="stylesheet"/>
	<!-- 穿梭框 -->
	<link th:href="@{/css/tranfer.css}" rel="stylesheet"/>
</head>

<!-- 通用JS -->
<div th:fragment="footer">
    <script th:src="@{/js/jquery.min.js}"></script>
	<script th:src="@{/js/bootstrap.min.js}"></script>
	<!--bootstrap-select 下拉框插件-->
	<script th:src="@{/js/bootstrap-select.min.js}"></script>
	<script th:src="@{/js/i18n/defaults-zh_CN.js}"></script>
	<!-- bootstrap-table 表格插件 -->
	<script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js}"></script>
	<script th:src="@{/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
	<script th:src="@{/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js}"></script>
	<script th:src="@{/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.min.js}"></script>
	<script th:src="@{/ajax/libs/bootstrap-table/extensions/columns/bootstrap-table-fixed-columns.js}"></script>
	<!-- jquery-validate 表单验证插件 -->
	<script th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
	<script th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
	<script th:src="@{/ajax/libs/validate/jquery.validate.extend.js}"></script>
	<!-- jquery-validate 表单树插件 -->
	<script th:src="@{/ajax/libs/bootstrap-treetable/bootstrap-treetable.js}"></script>
	<!-- jquery-export 表格导出插件 -->
	<script th:src="@{/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js}"></script>
	<script th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script>
	<!-- 遮罩层 -->
	<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
    <script th:src="@{/ajax/libs/iCheck/icheck.min.js}"></script>
	<script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
	<script th:src="@{/ajax/libs/layui/layui.js}"></script>
	<script th:src="@{/ruoyi/js/common.js?v=3.3.0}"></script>
	<script th:src="@{/ruoyi/js/ry-ui.js?v=3.3.0}"></script>
	<script th:inline="javascript">
		var ctx = [[@{/}]];
		// Ajax 请求封装
	    function http(url,type,data,callback) {
	        $.ajax({
	            url:url,
	            type:type,
	            data:data,
	            cache:false,
	            async:true,
	            dataType:"json",
	            success:function (response) {
	                callback(response);
	            },
	            error:function (error) {
	                console.log(error);
	            }
	        });
	    };
		function getQueryString(name) {
			var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
			var r = window.location.search.substr(1).match(reg);
			if (r != null) {
				return unescape(r[2]);
			}
			return null;
		};
	</script>
	<!-- IE兼容 -->
	<script th:src="@{/js/polyfill.min.js}"></script>
	<!-- vue插件 -->
	<script th:src="@{/js/vue.min.js}"></script>
	<script th:src="@{/js/axios.min.js}"></script>

</div>

<!-- ztree树插件 -->
<div th:fragment="ztree-css">
    <link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
</div>
<div th:fragment="ztree-js">
    <script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
</div>

<!-- ztree树插件第三方插件 -->
<div th:fragment="ztree-three">
<!--<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/demo.css}" rel="stylesheet"/>-->
<link th:href="@{/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css}" rel="stylesheet"/>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.core-3.5.js}"></script>
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.excheck-3.5.js}"></script>
</div>

<!-- select2下拉框插件 -->
<div th:fragment="select2-css">
    <link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
    <link th:href="@{/ajax/libs/select/select2-bootstrap.css}" rel="stylesheet"/>
</div>
<div th:fragment="select2-js">
    <script th:src="@{/ajax/libs/select/select2.js}"></script>
</div>

<!-- bootstrap-select下拉框插件 -->
<div th:fragment="bootstrap-select-css">
    <link th:href="@{/ajax/libs/bootstrap-select/bootstrap-select.css}" rel="stylesheet"/>
</div>
<div th:fragment="bootstrap-select-js">
    <script th:src="@{/ajax/libs/bootstrap-select/bootstrap-select.js}"></script>
</div>

<!-- datetimepicker日期和时间插件 -->
<div th:fragment="datetimepicker-css">
    <link th:href="@{/ajax/libs/datapicker/bootstrap-datetimepicker.min.css}" rel="stylesheet"/>
</div>
<div th:fragment="datetimepicker-js">
    <script th:src="@{/ajax/libs//datapicker/bootstrap-datetimepicker.min.js}"></script>
</div>

<!-- ui布局插件 -->
<div th:fragment="layout-latest-css">
    <link th:href="@{/ajax/libs/jquery-layout/jquery.layout-latest.css}" rel="stylesheet"/>
</div>
<div th:fragment="layout-latest-js">
    <script th:src="@{/ajax/libs/jquery-layout/jquery.layout-latest.js}"></script>
</div>

<!-- summernote富文本编辑器插件 -->
<div th:fragment="summernote-css">
    <link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/>
	<link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/>
</div>
<div th:fragment="summernote-js">
    <script th:src="@{/ajax/libs/summernote/summernote.min.js}"></script>
	<script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script>
</div>

<!-- cropbox图像裁剪插件 -->
<div th:fragment="cropbox-css">
    <link th:href="@{/ajax/libs/cropbox/cropbox.css}" rel="stylesheet"/>
</div>
<div th:fragment="cropbox-js">
    <script th:src="@{/ajax/libs/cropbox/cropbox.js}"></script>
</div>

<!-- jsonview格式化和语法高亮JSON格式数据查看插件 -->
<div th:fragment="jsonview-css">
    <link th:href="@{/ajax/libs/jsonview/jquery.jsonview.css}" rel="stylesheet"/>
</div>
<div th:fragment="jsonview-js">
    <script th:src="@{/ajax/libs/jsonview/jquery.jsonview.js}"></script>
</div>

<!-- vue组件 -->
<div th:fragment="vue-component">


	<!--项目信息-->


	<!-- 输入框组件 -->
	<script type="text/x-handlebars-template" id="inputComponent">
		<div v-show="inputData.show">
			<div style="width:100%;height:44px;line-height:44px;" class="row">
				<div style="display:inline-block;" align="right" >
					<span  v-show="inputData.title"><i style="color:red;" v-if="inputData.Asterisk">*</i>{{inputData.title}}</span>
				</div>
				<div style="display:inline-block;">
					<input v-bind:placeholder="inputData.placeholder"
						   v-bind:type="inputData.type"
						   v-model="inputData.value"
						   v-on:change="changeEvent"
						   v-bind:readonly="inputData.disabled" style="height:2rem;width:20rem;" />
				</div>
			</div>
		</div>
	</script>
	<script>
        Vue.component("inputComponent",{
            props:{
                index:{
                    type:Number,
                    required:false,
                },
                datas:{
                    type:Object,
                    required:true,
                    validator: function (value) {
                        return value.key!=="";
                    }
                },
            },
            data:function(){
                return {
                    inputData:this.datas,
                }
            },
            mounted:function(){
                console.log("inputComponent:",this.inputData,this.datas);
            },
            methods:{
                changeEvent:function () {
                    var o;
					if(this.index>=0){
                       o={k:"",v:"",index:""};
                        o.index=this.index;
					}else{
                        o={k:"",v:""};
					}
                    o.k=this.inputData.key;
                    o.v=this.inputData.value;
                    if(this.inputData.Required && o.v==""){
                        alert(this.inputData.title+"不能为空");
                    }
                    this.$emit("change",JSON.parse(JSON.stringify(o)));
                }
            },
            template:"#inputComponent"
        });
	</script>


	<!-- 下拉框组件 -->
	<script type="text/x-handlebars-template" id="selectComponent">
		<div class="selected-style">
			<div style="width:100%;height:44px;line-height:44px;" class="row">
				<div style="display:inline-block;" align="right">
					<span v-show="selectData.title"><i style="color:red;" v-if="selectData.Asterisk">*</i>{{selectData.title}}</span>
				</div>
				<div style="display:inline-block;">
					<select v-model="selectData.value" v-on:change="changeEvent" style="height:2rem;width:20rem;">
						<option v-for="(item,index) in option" v-bind:value="item.v">{{item.k}}</option>
					</select>
				</div>
			</div>

		</div>
	</script>
	<script>
        Vue.component("selectComponent",{
            props:{
                datas:{
                    type:Object,
                    required:true,
                    validator: function (value) {
                        return value.key!=="";
                    }
                }
            },
            data:function(){
                return {
                    selectData:this.datas,
                    option:this.datas.option,
                    // option:[{k:"",v:""}],
                }
            },
            mounted:function(){
                this.getData();
            },
            methods:{
                changeEvent:function () {
                    var o={k:"",v:""};
                    o.k=this.selectData.key;
                    o.v=this.selectData.value;
                    if(this.selectData.Required && o.v==""){
                        alert(this.selectData.title+"不能为空");
                    }
                    this.$emit("change",JSON.parse(JSON.stringify(o)));
                },
                getData:function(){
                    if(this.selectData.url!=""){
                        var that=this
						var method="get";
                        if(this.selectData.hasOwnProperty("method")){
                            method=this.selectData.method;
                        }
                        http(this.selectData.url,method,this.selectData.params,function(res){
                            that.option=[];
                            let vv=undefined;
                            if(res instanceof Array) {
                                vv=res;
							}
							if(res.hasOwnProperty("data") && res.data instanceof Array){
							    vv=res.data;
							}
                            for(var i=0;i<vv.length;i++){
                                console.log(vv[i][that.selectData.v],that.selectData.v);
                                that.option.push({k:vv[i][that.selectData.k],v:vv[i][that.selectData.v]});
                            }
                        });
                    }else{
                        console.warn("传入的url必须是一个地址");
                    }
                },
            },
            template:"#selectComponent"
        });
	</script>


	<!-- 上传文件组件 -->
	<script type="text/x-handlebars-template" id="filesComponent">
		<div class="files-style">
			<div class="row">
				<div align="right" style="height:44px;line-height:44px;display:inline-block;">
					<i style="color:red;" v-if="filesData.Asterisk">*</i>{{filesData.title}}
				</div>
				<div style="display:inline-block;">
					<input
							v-bind:type="filesData.type"
							v-bind:id="filesData.key"
							v-bind:class="filesData.key+'class'"
							@click="clearTipEvent()"
							@change="preview($event)"
							:accept="filesData.accept"
							style="width:20rem;display:inline;border:solid 1px #999;">

					<span style="width:30rem;display:inline-block;background:yellow;color:#771f1a;padding:0 8px;">{{tip}}</span>
					<div v-for="(item,index) in filesArr" style=" margin:16px 0;">
						<div>
							<span style="width:10rem;display:inline-block;text-align:right;">
								<span @click="closeEvent(index)" style="cursor:pointer;"><i class="fa fa-times" aria-hidden="true"></i></span>
							</span>
									<span style="text-align:left;display:inline-block;">
								{{item.name}}
							</span>
						</div>
					</div>
				</div>
			</div>

		</div>
	</script>
	<script>
        Vue.component("filesComponent",{
            props:{
                datas:{
                    type:Object,
                    required:false,
                    validator: function (value) {
                        return value.key!=="";
                    }
                }
            },
            data:function(){
                return {
                    filesData:this.datas,
                    filesArr:[],
                    tip:"",
                }
            },
            mounted:function () {},
            methods:{
                preview:function(event){
                    let fileEle=document.getElementById(this.filesData.key);
                    this.filesData.value=this.getObjectURL(fileEle.files[0],fileEle);
                    this.$emit('change',{k:this.filesData.key,v:this.filesData.value});
                },
                getObjectURL:function(files,ele) {
                    if(files){
                        let fileNameAccept=files.name.split(".");
                        let accept=fileNameAccept[fileNameAccept.length-1];
                        if(this.filesData.accept.split(",").indexOf(accept)>=0 || this.filesData.accept==""){
                            let isExist=true;
                            for(let i=0;i<this.filesArr.length;i++){
                                if(this.filesArr[i].name==files.name){
                                    isExist=false;
                                    this.tip="该资源已存在";
                                    console.warn("该资源已存在");
                                    break;
                                }
                            }
                            if(this.filesArr.length>=this.filesData.fileLength){
                                isExist=false;
                                this.tip="超过最大文件数量";
                                console.warn("超过最大文件数量");
                            }
                            if(isExist){
                                this.filesArr.push(files);
                            }
                        }else{
                            this.tip="文件格式不正确";
                            console.warn("文件格式不正确");
                        }
                        ele.value="";
                        ele.type = "text";
                        ele.type = "file";
                    }
                    if(this.filesData.fileLength==1){
                        return files;
                    }else{
                        return this.filesArr;
                    }
                },
                closeEvent:function(i){
                    this.filesArr.splice(i,1);
                },
                clearTipEvent:function () {
                    this.tip="";
                }
            },
            template:"#filesComponent"
        });
	</script>


	<!-- 项目详情组件 -->
	<script type="text/x-handlebars-template" id="projectDetail">
		<div class="projectDetail_content" style="width:100%;height:10rem;border:solid 1px #999999;">
			<div style="background:red;height:10rem;line-height:10rem;float:left;width:2rem;text-align:center;color:#fff;">{{projectData.type}}</div>
			<div style="height:10rem;float:right;width:97%;">
				<table cellspacing="0" cellpadding="0" border="0" style="margin-top:3rem;width:100%;">
					<tr>
						<td>项目编号:{{projectData.node2ProjectCode}}</td>
						<td>项目名称:{{projectData.projectName}}</td>
						<td>项目省市:{{projectData.projectRegion}}</td>
						<td>项目简介:{{projectData.node1ExpectBuildingArea}}</td>
					</tr>
					<tr>
						<td>项目联系人:{{projectData.node1ApplyName}}</td>
						<td>项目联系人电话:{{projectData.node1ApplyUserPhone}}</td>
						<td>预计签约月份:{{projectData.applyUserRegion}}</td>
						<td></td>
					</tr>
				</table>
			</div>
		</div>
	</script>
	<script>
        Vue.component("projectComponent",{
            data:function(){
                return {
                    projectData:{
                        projectId:"",
                        node2ProjectCode:"项目编号",
                        projectName:"项目名称",
                        projectRegion:"项目省市",
                        node1ExpectBuildingArea:"项目简介",
                        node1ApplyName:"项目联系人",
                        node1ApplyUserPhone:"项目联系人电话",
                        applyUserRegion:"预计签约月份",
                        type:"D",
                    }
                }
            },
            mounted:function(){
                var that=this;
                $.ajax({
                    url : prefix + "/project/info",
                    type : 'GET',
                    data : { projectId:getQueryString("projectId") },
                    cache: false,
                    contentType: false,
                    success: function(res) {
                        for(var i in res.data){
                            that.projectData[i]=res.data[i];
                        }
                    },
                    error: function(data, status, e) {
                        console.error(e);
                    }
                });
            },
            methods:{},
            template:"#projectDetail"
        });
	</script>


	<!-- 细分业态及单价组件 -->
	<script type="text/x-handlebars-template" id="tableComponent">
		<div class="table-style">
			<h4>{{tableData.title}} <button class="btn btn-primary btn-rounded btn-sm" v-on:click="showAdd()">{{showTitle}}</button></h4>

			<table style="width:100%;" border="0" cellpadding="0" cellspacing="0" >

				<thead>
					<tr >
						<th style="text-align: center;">序号</th>
						<th style="text-align: center;">业态</th>
						<th style="text-align: center;">建筑面积</th>
						<th style="text-align: center;">单价（元/㎡·月或元/个·月）</th>
						<th style="text-align: center;">操作</th>
					</tr>
				</thead>

				<tbody>
					<tr v-for="(item,index) in tableData.children">
						<td>{{index+1}}</td>
						<td>{{item.projectStatus}}</td>
						<td>{{item.area}}</td>
						<td>{{item.price}}</td>
						<td><span v-on:click="close(index)"><i class="fa fa-times-circle" aria-hidden="true"></i></span></td>
					</tr>
					<tr v-show="tableShow">
						<td>{{tableData.children.length+1}}</td>
						<td v-for="item in tableData.option">
							<span v-if="item.type=='text'"><input-component v-bind:datas="item" v-on:change="changeEvent"></input-component></span>
							<span v-if="item.type=='select'"><select-component v-bind:datas="item" v-on:change="changeEvent"></select-component></span>
						</td>
						<td>
							<span v-on:click="add()"><i class="fa fa-check-square" aria-hidden="true"></i></span>
						</td>
					</tr>
				</tbody>

			</table>
		</div>
	</script>
	<script>
        Vue.component("tableComponent",{
            props:{
                datas:{
                    type:Object,
                    required:true,
                    validator: function (value) {
                        return value.key!=="";
                    }
                }
            },
            data:function(){
                return {
                    showTitle:"新增",
                    tableShow:false,
                    tableData:this.datas,
                }
            },
            mounted:function(){},
            methods:{
                changeEvent(o){
                    console.log(o);
                    this.tableData.mockData[o.k]=o.v;
                },
                showAdd:function(){
                    this.showTitle = this.showTitle == "新增" ? "取消" : "新增";
                    this.tableShow=!this.tableShow;
                    this.clearValue();
                },
                add:function () {
                    this.tableData.children.push(JSON.parse(JSON.stringify(this.tableData.mockData)));
                    this.tableData.mockData={projectStatus:"",area:"",price:""};
                    this.clearValue();
                    this.emitEvent();
                },
                close:function (index) {
                    console.log(this.tableData.children,index);
                    this.tableData.children.splice(index,1);
                    this.emitEvent();
                },
                clearValue:function () {
                    for(var i=0;i<this.tableData.option.length;i++){
                        this.tableData.option[i].value="";
                    }
                },
                emitEvent:function () {
                    var o={k:"",v:""};
                    o.k=this.tableData.key;
                    o.v=this.tableData.children;
                    this.$emit("change",JSON.parse(JSON.stringify(o)))
                }
            },
            template:"#tableComponent",
        });
	</script>


	<!-- 指标管理 -->
	<script type="text/x-handlebars-template" id="inputGroupComponent">
		<div>
			<div v-for="(item,index) in groupData.children">
				<p>第{{item.title}}年</p>
				<div v-for="(items,number) in item.option">
					<input-component v-bind:datas="items" v-bind:index="index+1" v-on:change="changeEvent"></input-component>
				</div>
			</div>
			<btn class="btn btn-primary" v-on:click="add">新增下一年指标</btn>
			<btn class="btn btn-primary" v-on:click="remove">删除指标</btn>
			<btn class="btn btn-primary" v-on:click="changeSubmit">确定</btn>
		</div>
	</script>
	<script>
        //{year:v.year,collectionRate:v.k1.value,mainRevenue:v.k2.value,costAmount:v.k3.value,netProfitAmount:v.k4.value,subsidyAmount:v.k5.value}
        Vue.component("inputGroupComponent",{
            props:{
                datas:{
                    type:Object,
                    require:true,
                    default:{}
                }
            },
            data:function(){
                return {
                    objValue:{
                        year:1,
                        collectionRate:"",
                        mainRevenue:"",
                        costAmount:"",
                        netProfitAmount:"",
                        subsidyAmount:"",
                    },
                    mockData:{
                        title:0,
                        option:[
                            {
                                type:"text",
                                key:"year",
                                value:"",
                                title:"年份",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                            {
                                type:"text",
                                key:"collectionRate",
                                value:"",
                                title:"收缴率（%）",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                            {
                                type:"text",
                                key:"mainRevenue",
                                value:"",
                                title:"主营收入（元）",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                            {
                                type:"text",
                                key:"costAmount",
                                value:"",
                                title:"补贴（元）",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                            {
                                type:"text",
                                key:"netProfitAmount",
                                value:"",
                                title:"成本（元）",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                            {
                                type:"text",
                                key:"subsidyAmount",
                                value:"",
                                title:"净利润（元）",
                                Required:true,
                                disabled:false,
                                placeholder:"请输入",
                                show:true,
                            },
                        ]
                    },
                    groupData:this.datas,
                }
            },
            mounted:function(){},
            methods:{
                changeEvent:function(o){
                    console.log("inputGroupComponent:",o,JSON.parse(JSON.stringify(this.groupData.value)));
                    this.groupData.value[o.index-1][o.k]=o.v;
                },
                add:function () {
                    this.mockData.title=this.groupData.children.length+1;
                    this.mockData.option[0].value=this.groupData.children.length+1;
                    this.objValue.year=this.groupData.children.length+1;

                    this.groupData.children.push(JSON.parse(JSON.stringify(this.mockData)));
                    this.groupData.value.push(JSON.parse(JSON.stringify(this.objValue)));
                },
                remove:function () {
                    this.groupData.children.pop();
                    this.groupData.value.pop();
                },
                changeSubmit:function () {
                    console.log(JSON.parse(JSON.stringify(this.groupData.value)));
                    var o={k:"",v:""};
                    o.k=this.groupData.key;
                    o.v=JSON.stringify(this.groupData.value);
                    this.$emit("change",JSON.parse(JSON.stringify(o)));
                }
            },
            template:"#inputGroupComponent"
        });
	</script>

	<!-- 数组类型字符串 -->
	<script type="text/x-handlebars-template" id="opinionsComponent">
		<div>
			<div v-for="(item,index) in opinionsDatas.option">
				<div style="display:inline-block;width:27rem;"><input-component v-bind:datas="item" v-bind:index="index" v-on:change="changeEvent"></input-component></div>
				<div style="display:inline-block;width:auto"><span v-on:click="close(index)"><i class="fa fa-times-circle" aria-hidden="true"></i></span></div>
			</div>
			<div>
				<span v-on:click="add"><i class="fa fa-plus-circle" aria-hidden="true"></i></span>
			</div>
		</div>
	</script>
	<script>
        Vue.component("opinionsComponent",{
            props:{
                datas:{
                    type:Object,
                    required:true,
                    validator: function (value) {
                        return value.key!=="";
                    }
                }
            },
            data:function(){
                return {
                    opinionsDatas:this.datas,
                }
            },
            mounted:function(){},
            methods:{
                changeEvent:function (o) {
                    this.opinionsDatas.value[o.index]=o.v;
                    //console.log("opinionsComponent:",o,JSON.parse(JSON.stringify(this.opinionsDatas.value)));
                    var vv={k:this.opinionsDatas.key,v:this.opinionsDatas.value};
                    this.$emit("change",JSON.parse(JSON.stringify(vv)));
                },
                add:function () {
                    this.opinionsDatas.option.push(JSON.parse(JSON.stringify(this.opinionsDatas.inputMock)));
                },
                close:function (index) {
                    console.log(index);
                    this.opinionsDatas.value.splice(index,1);
                    this.opinionsDatas.option.splice(index,1);
                }
            },
            template:"#opinionsComponent"
        });
	</script>

	<!-- 工具 -->
	<script>
        function getQueryString(name){
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }
	</script>
</div>
